﻿<UserControl x:Class="Flare.Pages.ITContract.Edit" 
             xmlns:Controls="clr-namespace:Flare.Controls"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:db="clr-namespace:Flare.DB"
             mc:Ignorable="d"
             d:DesignHeight="800" d:DesignWidth="1200">

    <UserControl.Resources>

        <ObjectDataProvider x:Key="ContactServicesDataSet" ObjectType="{x:Type db:contract_services}"
                            MethodName="Index" IsAsynchronous="False"/>

        <ObjectDataProvider x:Key="ContactProviderDataSet" ObjectType="{x:Type db:contract_providers}"
                            MethodName="Index" IsAsynchronous="False" />

        <ObjectDataProvider x:Key="ContactLocationDataSet" ObjectType="{x:Type db:general_departments}"
                            MethodName="Index" IsAsynchronous="False" />
    </UserControl.Resources>

    <StackPanel Orientation="Vertical">
        
        <Controls:FlameMenu x:Name="Service" Caption="Вид услуги" DockPanel.Dock="Top" SelectedValuePath="id_service" DisplayMemberPath="service"
                      ItemsSource="{Binding Source={StaticResource ContactServicesDataSet}}" SelectedValue="{Binding id_service, Mode=OneWay}" />

        <Controls:FlameMenu x:Name="Provider" Caption="Поставщик" DockPanel.Dock="Top" SelectedValuePath="id_provider" DisplayMemberPath="provider"
                      ItemsSource="{Binding Source={StaticResource ContactProviderDataSet}}" SelectedValue="{Binding id_provider, Mode=OneWay}" />

        <Controls:FlameMenu x:Name="Department" Caption="Отдел" DockPanel.Dock="Top" SelectedValuePath="id_department" DisplayMemberPath="department"
                      ItemsSource="{Binding Source={StaticResource ContactLocationDataSet}}" SelectedValue="{Binding id_department, Mode=OneWay}" />

        <Controls:FlameTbox x:Name="Contractnumber" Header="Номер контракта" Margin="10,40,0,0" DockPanel.Dock="Top" Width="400" 
                            Text="{Binding contract_number}" />

        <Controls:FlameTbox x:Name="Contractdescription" Header="Примечание к контракту" Margin="10,10,0,0" DockPanel.Dock="Top" Width="600"                
                            Text="{Binding contract_description}"/>

        <Controls:FlameButtonInfo x:Name="saveButton" Content="Сохранить" Margin="10,40,0,0" HorizontalAlignment="Left" Click="saveButton_Click"/>
    </StackPanel>
</UserControl>
